package com.cn.qgx428.lazydiary.network.service

import com.cn.qgx428.lazydiary.network.bean.*
import retrofit2.http.*
import rx.Observable

/**
 * Created by qinguanxiong on 2018/3/19.
 */
interface DiaryService {
    @GET("Diary/createDiary")
    fun createDiary(@Query("userId") userId: Int,
                    @Query("title") title: String,
                    @Query("createTime") createTime: String):
            Observable<CommonInserResponse>

    @GET("Diary/fillDiary")
    fun fillDiary(@Query("diaryId") diaryId: Int,
                  @Query("type") type: String,
                  @Query("info") info: String,
                  @Query("sequence") sequence: Int):
            Observable<CommonResponse>

    @GET("Diary/getDiaries")
    fun getDiaries(@Query("userId") userId: Int):
            Observable<DiaryResponse>

    @GET("Diary/getDiaryContent")
    fun getDiaryContent(@Query("diaryId") diaryId: Int):
            Observable<DiaryContentResponse>

    @FormUrlEncoded
    @POST("Diary/updateDiary")
    fun updateDiary(@Query("diaryId") diaryId: Int,
                    @Field("title") title: String):
            Observable<CommonResponse>

    @GET("Diary/getLatestBrife")
    fun getLatestBrife(@Query("userId") userId: Int):
            Observable<DiaryLatestBrifeResponse>
}